import java.util.Arrays;
import java.util.Scanner;

//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] arrays = new  int [n];
        for (int i = 0; i < n; i++){
            int a = scanner.nextInt();
            arrays[i] = a;
        }
        Arrays.sort(arrays);

        int m = scanner.nextInt();
        int t = 0;
        for (int i = 0; i < n; i++) {
            if (m == arrays[i]) {
                i = i + 1;
                System.out.println(i);
                return;
            }
            t++;
        }
        if (t != 0){
            System.out.println("-1");
        }
    }
}